/**
 * 
 */
package gui.text;

import javax.swing.text.Element;
import javax.swing.text.LabelView;
import javax.swing.text.View;

/**
 * @author Joshua Lockerman
 *
 */
public class EquationView extends LabelView {
    
    /**
     * @param elem
     */
    public EquationView(Element elem)
    {
        super(elem);
    }
    
    @Override
    public int getBreakWeight(int axis, float pos, float len)
    {
        if(axis == View.Y_AXIS) {
            // return super.getBreakWeight(axis, pos, len);
        }
        
        return ExcellentBreakWeight;
    }
    
    @Override
    public View breakView(int axis, int p0, float pos, float len)
    {
        if(axis == View.Y_AXIS) {
            // return super.breakView(axis, p0, pos, len);
        }
        checkPainter();
        int p1 = getGlyphPainter().getBoundedPosition(this, p0, pos, len);
        if(p0 == getStartOffset() && p1 == getEndOffset()) {
            return this;
        }
        return createFragment(p0, p1);
        
    }
    
}
